package com.lsq;

import com.lsq.config.AppConfig;
import com.lsq.service.UserInterface;
import com.lsq.service.UserService;
import com.spring.ApplicationContext;

/**
 * 请描述当前类的作用
 *
 * @author LSQ
 * @since 2023/2/13 19:39
 */
public class Test {

    public static void main(String[] args) {

        // 创建单例bean
        ApplicationContext applicationContext = new ApplicationContext(AppConfig.class);


        System.out.println(applicationContext.getBean("userService"));
        System.out.println(applicationContext.getBean("userService"));
        System.out.println(applicationContext.getBean("userService"));

        System.out.println(applicationContext.getBean("orderService"));
        System.out.println(applicationContext.getBean("orderService"));
        System.out.println(applicationContext.getBean("orderService"));


        UserService userInterface = (UserService) applicationContext.getBean("userService");
        userInterface.test();

    }

}
